'''
def main():
    array = [1, 3, 2, 5, 5, 4, 6, 7, 9, 8, 10, 3]
    print(array)
    sort_array = InsertSort(array)

    print("Sorted Array using Insertion Sort:")
    sort_array = PrintSort(sort_array)
    print(sort_array)

if __name__ == "__main__":
    main()
    '''
import matplotlib
from Sort import InsertSort,PrintSort

def insertion_sort(arr):
    for i in range(1, len(arr)):
        key = arr[i]
        j = i - 1
        while j >= 0 and key < arr[j]:
            arr[j + 1] = arr[j]
            j -= 1
        arr[j + 1] = key
    return arr

arr = [12, 11, 13, 5, 6]
print("原始数组：", arr)
sorted_arr = insertion_sort(arr)
print("插入排序后的数组：", sorted_arr)

test_array=PrintSort(sorted_arr)
test_array.print_sort()

